Skip to content

Conversation

StrangePan
Copy link
Contributor

@StrangePan StrangePan commented Jul 23, 2025

Check NSWindow::isVisible before sending SDL_WINDOWEVENT_RESTORED during Cocoa_WindowListener::windowDidResize

This is a backport of #13409 to SDL3

Description

Fixes SDL_WINDOWEVENT_RESTORED being sent to the application while the window is still miniaturized. This can happen if macOS resizes the window as a result of a display density change.

This can happen if the user changes their display resolution settings in System Preferences > Displays from the default on a retina display to 2x the default.

This can also happen if the user disconnects a non-retina display and the OS needs to move all application windows to another retina display.

In either case, any miniaturized windows will be resized accordingly while remaining miniaturized. SDL was treating all window resizes as if the window was visible and not miniaturized, which is not true.

@Kontrabant
Copy link
Contributor

Merged, thanks!

@Kontrabant Kontrabant merged commit e610529 into libsdl-org:SDL2 Jul 28, 2025
34 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants